package com.gdpa.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.gdpa.entity.BrokerBuilding;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.gdpa.entity.BrokerBuildingWithAreaName;
import com.gdpa.entity.SaleArea;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 经纪楼盘表 Mapper 接口
 * </p>
 *
 * @author zsr
 * @since 2018-12-19
 */
public interface BrokerBuildingMapper extends BaseMapper<BrokerBuilding> {
    //根据条件获取楼盘信息/获取所有楼盘信息
    List<BrokerBuildingWithAreaName> getBuilding(Page page, @Param("search")String search);

    //获取楼盘的ID和名称
    List<BrokerBuildingWithAreaName> getBuildingNameAndId();

    //添加楼盘
    boolean add(BrokerBuildingWithAreaName brokerBuildingWithAreaName);

    //根据ID删除楼盘
    boolean deleteById(@Param("id") Integer id);

    //根据ID查找楼盘
    BrokerBuilding getById(@Param("id") Integer id);

    //根据ID修改楼盘
    boolean update(BrokerBuilding brokerBuilding);

    //获取销售区域
    List<SaleArea> getSaleArea();

    //通过楼盘ID获取销售区域和租赁区域的ID
    BrokerBuildingWithAreaName getAreaId(@Param("id") Integer id);
}
